<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Insert title here</title>
		<link rel="stylesheet" href="/wK2un11/houtai/lib/layui/css/layui.css" />
	</head>

	<body>
		<form class="layui-form" action="">
			
			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label">公司介绍</label>
				<div class="layui-input-block">
					<textarea name="homeInfo" id="homeInfo" lay-verify="content">
					${s.homeInfo }
					</textarea>
				</div>
			</div>
			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label">详细介绍</label>
				<div class="layui-input-block">
					<textarea name="info" placeholder="请输入内容" class="layui-textarea">
					${s.info }
					</textarea>
				</div>
			</div>
			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label">企业文化</label>
				<div class="layui-input-block">
					<textarea name="culture" placeholder="请输入内容" class="layui-textarea">
					${s.culture }
					</textarea>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">招商电话</label>
				<div class="layui-input-block">
					<input type="text" name="zsTel" value="${s.zsTel }" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">联系电话</label>
				<div class="layui-input-block">
					<input type="text" name="lxTel" value="${s.lxTel }" lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">邮箱</label>
				<div class="layui-input-block">
					<input type="text" name="email" value="${s.email }" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">公司地址</label>
				<div class="layui-input-block">
					<input type="text" name="address" value="${s.address }" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">经度</label>
				<div class="layui-input-block">
					<input type="text" name="x" value="${s.x }" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">纬度</label>
				<div class="layui-input-block">
					<input type="text" name="y" value="${s.y }" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
				</div>
			</div>
			
			
			
			
			
			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit lay-filter="formDemo">立即修改</button>
				</div>
			</div>
		</form>
<script type="text/javascript" src="/wK2un11/houtai/lib/layui/layui.js"></script>
		<script>
		//加载了layui的form模块
		layui.use(['form','layedit'], function() {
			var form = layui.form;
			var $ = layui.jquery; //引入jquery
			var layedit = layui.layedit;
			var index= layedit.build('homeInfo');//建立编辑器
			form.verify({
				content:function(value){
					return layedit.sync(index);
				}
			});
			//监听提交
			form.on('submit(formDemo)', function(data) {
				var d = data.field; //表单中的数据，定义一个对象来接收
				d.method ="getupdate"; // 我的密匙、大家用你们自己的
				//通过ajax向数据库提交数据了
				console.log(d); //提交之前的一个数据验证、通过打印的方式先手动的去判断一下这个数据
				var url = '/wK2un11/Houhomeinfoservlet';
							       
				//确保数据没有问题就进行ajax提交了
				$.post(url, d,
					function(data) {
						if(data.count>0){
							 console.log('修改成功');
							layer.msg('修改成功');
						}
					}, "json");
				return false;
			});
		});
		</script>
	</body>

</html>